<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
    <style>
      div img {
        width: 200px;
        height: 200px;
      }
    </style>
  </head>
  <body>
    <div id="box">
      <img src="./img/longmao.webp" id="img" alt="" />
    </div>
    <button id="btn">longmao</button>
    <script>
      document.getElementById('btn').onclick = function () {
        var imgNode = document.getElementsByTagName('img');
        var res = imgNode[0].cloneNode(true);
        var boxEle = document.getElementById('box');
        console.log(boxEle);
        boxEle.appendChild(res);
      };
    </script>
  </body>
</html>
